/**
 * @fileOverview HightController Modul file
 * 
 * @author Adam Hořčica horcicaa@gmail.com
 * @url $HeadURL: http://ahs-gadgets.googlecode.com/svn/trunk/bb-counters/src/height_controller.js $
 * @revision $Id: height_controller.js 47 2008-02-09 20:30:13Z horcicaa $
 */

/**
 * Control of gadget height
 * @static
 */ 
var HightController = {
  
  /** Use dynamic height */
  dynamicHeight: false,
  
  /**
   * Initialize HightController   
   * @param {object} prefs Preferents object (_IG_Prefs)
   */     
  init: function(prefs, container)
  {
    this.dynamicHeight = prefs.getBool("height");
    
    if(!this.dynamicHeight)
    {
      /*
      var height = document.body.scrollHeight;
      container.style.overflowY = "auto";
      container.style.height = height + "px";
      */
      $('items').className += "static_height";
      _IG_AdjustIFrameHeight(200); /* default is 200px */
    }
  },
  
  /**
   * Adjust Height of gadget iframe (if dynamicHeight is set) 
   */     
  resize: function()
  {
    if(this.dynamicHeight)
    {
      _IG_AdjustIFrameHeight();
    }
  }
  
};
